package com.nxm.controller;

import com.nxm.services.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("test")
public class TestController {
    @Autowired
    private TestService testService;

    @RequestMapping("test")
    public ModelAndView test(){
        ModelAndView mv=new ModelAndView();
        Long id=1003L;
        mv.addObject("data",testService.getById(id));
        mv.setViewName("test");
        return mv;
    }
    @RequestMapping("testTwo")
    public ModelAndView testTwo(){
        ModelAndView mv=new ModelAndView();
        Long id=1000L;
        mv.addObject("data",testService.getByIdTwo(id));
        mv.setViewName("test");
        return mv;
    }
}
